<html>
<head><meta charset="utf-8"><title>Pattern matching on box · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html">Pattern matching on box</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="195230800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195230800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195230800">(Apr 24 2020 at 19:00)</a>:</h4>
<p>This is probably a regular question but what is the best way to match on an enum where one of the variant is holding a box? I have a recursive enum, so i boxed the variant value:</p>
<div class="codehilite"><pre><span></span>enum RecurEnum {
   Variant1,
   Variant2,
   Variant3(Box&lt;RecurEnum&gt;),
}
</pre></div>



<a name="195230879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195230879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195230879">(Apr 24 2020 at 19:01)</a>:</h4>
<p>What i would want is writing a match pattern for <code>Variant1 | Variant3(Variant1) =&gt; ...</code></p>



<a name="195231081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231081">(Apr 24 2020 at 19:03)</a>:</h4>
<p>but this does not work because of the box. I tried <code>Variant1 | Variant3(inner) if *inner == Variant1 =&gt; ...</code> but that does not work either because <code>inner</code> is only available in the second case</p>



<a name="195231171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231171">(Apr 24 2020 at 19:03)</a>:</h4>
<p>It's not a regular question I've seen before. :)</p>



<a name="195231237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231237">(Apr 24 2020 at 19:04)</a>:</h4>
<p>I don't think you can match "through" a box directly. And I don't think you'll be able to combine patterns like that.</p>



<a name="195231264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231264">(Apr 24 2020 at 19:04)</a>:</h4>
<p>If you only needed to match <code>Variant3</code> you could do something like that.</p>



<a name="195231308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231308">(Apr 24 2020 at 19:05)</a>:</h4>
<p>Do you want to match deeper than one level?</p>



<a name="195231343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231343">(Apr 24 2020 at 19:05)</a>:</h4>
<p>As in, do you want to match a Variant3 containing a Variant3 containing a Variant2?</p>



<a name="195231356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231356">(Apr 24 2020 at 19:05)</a>:</h4>
<p>No i really just want <code>Variant1 | Variant3(Variant1) =&gt; ...</code></p>



<a name="195231416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231416">(Apr 24 2020 at 19:06)</a>:</h4>
<p>OK, then I can think of one way you could build that reasonably ergonomically.</p>



<a name="195231443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231443">(Apr 24 2020 at 19:06)</a>:</h4>
<p>any other case is an error for me</p>



<a name="195231454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sebastian Malton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231454">(Apr 24 2020 at 19:06)</a>:</h4>
<p>You could if you use <code>box patterns</code> (I think)</p>



<a name="195231493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231493">(Apr 24 2020 at 19:06)</a>:</h4>
<p><span class="user-mention silent" data-user-id="247082">Sebastian Malton</span> <a href="#narrow/stream/122651-general/topic/Pattern.20matching.20on.20box/near/195231454" title="#narrow/stream/122651-general/topic/Pattern.20matching.20on.20box/near/195231454">said</a>:</p>
<blockquote>
<p>You could if you use <code>box patterns</code> (I think)</p>
</blockquote>
<p>That would require nightly Rust though, right?</p>



<a name="195231502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231502">(Apr 24 2020 at 19:06)</a>:</h4>
<p>yeah but i've read its experimental and phasing out</p>



<a name="195231526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sebastian Malton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231526">(Apr 24 2020 at 19:07)</a>:</h4>
<p>Yeah, nightly... But I also don't know why it is being phased out</p>



<a name="195231575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231575">(Apr 24 2020 at 19:07)</a>:</h4>
<p>because of placement new RFC being refused or something</p>



<a name="195231635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231635">(Apr 24 2020 at 19:08)</a>:</h4>
<p>but maybe the box keyword will be kept _only_ for pattern matching? idk</p>



<a name="195231673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sebastian Malton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231673">(Apr 24 2020 at 19:08)</a>:</h4>
<p>Oh, removing both <code>let x = box Foo::new();</code> and <code>if let box y = x { ... }</code>?</p>



<a name="195231674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231674">(Apr 24 2020 at 19:08)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">impl</span><span class="w"> </span><span class="n">RecurEnum</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">self_or_variant3</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="nc">RecurEnum</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">Self</span>::<span class="n">Variant3</span><span class="p">(</span><span class="k">ref</span><span class="w"> </span><span class="n">thebox</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">thebox</span><span class="p">.</span><span class="n">as_ref</span><span class="p">()</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="bp">self</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="195231686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231686">(Apr 24 2020 at 19:08)</a>:</h4>
<p>(Not compile-checked, rough sketch only.)</p>



<a name="195231757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231757">(Apr 24 2020 at 19:09)</a>:</h4>
<p>Hum I see</p>



<a name="195231788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231788">(Apr 24 2020 at 19:09)</a>:</h4>
<p>Then you could match on foo.self_or_variant3() and check for Variant1.</p>



<a name="195231808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231808">(Apr 24 2020 at 19:09)</a>:</h4>
<p>That's assuming you <em>don't</em> need to distinguish the two cases, but if you do you can always check that within the match arm.</p>



<a name="195231968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195231968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sebastian Malton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195231968">(Apr 24 2020 at 19:11)</a>:</h4>
<p>Yeah, I was correct. It does work on nightly: <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=438b915dccf9f13147f7132ca670d18a" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=438b915dccf9f13147f7132ca670d18a">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=438b915dccf9f13147f7132ca670d18a</a></p>
<p>However, I think Josh is right, that there isn't really a better way...</p>



<a name="195232012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232012">(Apr 24 2020 at 19:11)</a>:</h4>
<p>Another option would be functions like <code>.is_variant1()</code> and <code>.is_variant2()</code> that check through a Variant3 too.</p>



<a name="195232034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232034">(Apr 24 2020 at 19:11)</a>:</h4>
<p>Depends on what patterns commonly occur in your code.</p>



<a name="195232119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232119">(Apr 24 2020 at 19:12)</a>:</h4>
<p>(Out of curiosity, if you don't mind sharing, what's the concrete nature of <code>RecurEnum</code> in your problem space? I'd love to know what the problem and variants actually are.)</p>



<a name="195232131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232131">(Apr 24 2020 at 19:12)</a>:</h4>
<p>Its only for one specific place in the code that's why i did not want to introduce a specific function for that at the beginning</p>



<a name="195232156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232156">(Apr 24 2020 at 19:12)</a>:</h4>
<p>Well, if it's only for the one specific place, you might just write an <code>if let</code>. :)</p>



<a name="195232184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232184">(Apr 24 2020 at 19:12)</a>:</h4>
<p>its an interpreter for a small DSL</p>



<a name="195232216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232216">(Apr 24 2020 at 19:13)</a>:</h4>
<p>Makes sense.</p>



<a name="195232230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232230">(Apr 24 2020 at 19:13)</a>:</h4>
<p><a href="https://github.com/cloudflare/wirefilter/tree/cloudflare" title="https://github.com/cloudflare/wirefilter/tree/cloudflare">https://github.com/cloudflare/wirefilter/tree/cloudflare</a></p>



<a name="195232302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232302">(Apr 24 2020 at 19:14)</a>:</h4>
<p>And in my case, i have a <code>Type</code> enum</p>



<a name="195232360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232360">(Apr 24 2020 at 19:14)</a>:</h4>
<p>and <code>Type</code> has an <code>Array</code> variant ...</p>



<a name="195232398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232398">(Apr 24 2020 at 19:14)</a>:</h4>
<p>which holds a <code>Box&lt;Type&gt;</code> to represent the type of the values in the array</p>



<a name="195232478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232478">(Apr 24 2020 at 19:15)</a>:</h4>
<p>Thanks a lof the help!</p>



<a name="195232508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195232508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195232508">(Apr 24 2020 at 19:15)</a>:</h4>
<p>No problem. Hope it works out. :)</p>



<a name="195254197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195254197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rpjohnst <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195254197">(Apr 24 2020 at 23:00)</a>:</h4>
<p>A bit late to this but if you have any plans to move your DSL nodes into an arena in the future, you would at that point be able to switch from Box to &amp; and get normal pattern matching back.</p>



<a name="195278835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pattern%20matching%20on%20box/near/195278835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pattern.20matching.20on.20box.html#195278835">(Apr 25 2020 at 10:30)</a>:</h4>
<p>I am not sure i understand what you mean :/</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>